package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.financing.wap.common.CommonConstantUtil.CommonStatus;
import com.financing.wap.dao.IDstUserWechatSendLogDao;
import com.financing.wap.dto.DstUserWechatSendLogDTO;
import com.financing.wap.service.IDstUserWechatSendLogService;
import com.financing.wap.util.DTOdateSetUtil;
/**
 * dst_user_wechat_send_log  
 * 用户微信推送流水  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Service("dstUserWechatSendLogService")
public class DstUserWechatSendLogServiceImpl implements IDstUserWechatSendLogService{

	@Autowired
	private IDstUserWechatSendLogDao dstUserWechatSendLogDao;

	@Override
	public int insert(DstUserWechatSendLogDTO dstUserWechatSendLog) throws SQLException {
		dstUserWechatSendLog.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return dstUserWechatSendLogDao.insert(dstUserWechatSendLog);
	}

	@Override
	public void update(DstUserWechatSendLogDTO dstUserWechatSendLog) throws SQLException {
		dstUserWechatSendLogDao.update(dstUserWechatSendLog);
	}

	@Override
	public void updateForce(DstUserWechatSendLogDTO dstUserWechatSendLog) throws SQLException {
		dstUserWechatSendLogDao.updateForce(dstUserWechatSendLog);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		dstUserWechatSendLogDao.delete(id);
	}
	
	@Override
	public List<DstUserWechatSendLogDTO> queryList(DstUserWechatSendLogDTO dstUserWechatSendLog) throws SQLException {
		return dstUserWechatSendLogDao.queryList(dstUserWechatSendLog);
	}

	@Override
	public int queryListCount(DstUserWechatSendLogDTO dstUserWechatSendLog) throws SQLException {
		return dstUserWechatSendLogDao.queryListCount(dstUserWechatSendLog);
	}

	@Override
	public DstUserWechatSendLogDTO loadById(Integer id) throws SQLException {
		return dstUserWechatSendLogDao.loadById(id);
	}
 	@Override
	public DstUserWechatSendLogDTO queryListGetFirst(DstUserWechatSendLogDTO dstUserWechatSendLog)
			throws SQLException {
		 List<DstUserWechatSendLogDTO> queryList = queryList(dstUserWechatSendLog);
		 if(queryList==null||queryList.size()==0){
			 return new DstUserWechatSendLogDTO();
		 }
		 return queryList.get(0);
	}
}
